<div class="content-l">
	<div style="margin:0 13px 13px 13px;">
	<div class="thirdclass-nav" xmlns:i="178">
		<a class="textnav-current" href="<?= Controller::_makeURL('friends', 'group', 'mutu_friends')?>" <?if ($this->action=='mutu_friends'):?> class="textnav-current" <?endif;?>>好友的好友</a>
		<span class="spacing-line">|</span>
		<a href="<?= Controller::_makeURL('friends', 'armory', 'index')?>" <?if ($this->controller=='armory'):?> class="textnav-current"  <?endif;?> >您可能认识的人</a>
		<div class="sshy" ><span>搜索好友：</span><input name="k" id="k" type="text" /><input name="" onclick="Friends.search('k');" type="button" value="搜索" /></div>
	</div>

	</div>

<?php if ($this->ret):?>
<div class="seplinetop">共有<strong class="red"><?=$this->pageInfo['COUNT']?></strong>位好友的好友</div>
<div class="column">
<?php foreach($this->ret as $i => $row):?>
<div>
<div class="friend190">
<div class="avatar50"><a href="/?uid=<?=$row['id']?>" target="_blank"><img src="<?= avatar_util_saver::get_path($row['id'], 50)?>"/></a></div>
<div class="leftfix">
	<?if(Util::isOnline($row['id'])):?><i:online xmlns:i="178"/><?endif;?>
	<i:name xmlns:i="178" uid="<?=$row['id']?>" username="<?=$row['username']?>"  length="10" <?if ($row['is_check']):?>class="a-id-right dynamic-name"<?endif;?>/>
	<?if ($row['is_check']):?><i class="fixie6png star-icon" title="已通过魔兽身份认证"></i><?endif;?>
    <p>所在地： <span style="color:#333"> <?=isset($row['r_province']) ? htmlspecialchars($row['r_province']) : '';?></span> </p>
  </div>
<div class="clearfix"></div>
</div>
<div class="rightfix mt26 mr13">
<font class="gray">共同好友数：</font><?=$row['comm_nums']?>人 
<a href="javascript:void(0)" onclick="$$('.right-popup').select(function(i){return i.hide()}); getCommFriends(<?=$row['id']?>);" title="点击查看共同好友名单" >(详情)</a>

<!--popup -->
<div class="right-popup"  id="mutu_friends_<?=$row['id']?>" style="display:none; width: 200px">
<div class="popup">
<div class="popup-top"><div class="popup-top-right"><div class="popup-top-mid"></div></div></div>
<div class="popup-mid">
	<div class="popup-mid-main">
	<div class="popup-mid-main-top" style="background:#fff; border:none">
		<a href="javascript:;" onclick="$('mutu_friends_<?=$row['id']?>').hide();" class="popup-closebtn" target="_self" title="关闭窗口"></a>
	</div>
	<div class="popup-mid-main-mid">
	<div class="popup-mid-main-mid-content" id="commfriend_<?=$row['id']?>"><img src="/images/loading.gif"></div>
</div>
</div>	  
</div>
<div class="popup-bottom"><div class="popup-bottom-right"><div class="popup-bottom-mid"></div></div></div>
</div>
</div>
<!--end popup-->

</div>
<div class="clearfix"></div>
</div>
<?php endforeach;?>
<div class="clearfix"></div>
<div class="sepline13"><?php echo $this->genPages($this->pageInfo);?></div>
</div>
<?php else:?>
	<i:info type="friendly" xmlns:i="178">你还没有添加过好友</i:info>
<?php endif;?>	 
</div> <!--end content-l -->
<script type="text/javascript">
function getCommFriends(uid) {
	new Ajax.Request("/~friends.group.get_common_friend",{
		method: 'post',
		parameters: 'uid=' + uid + '&r=' + Math.random(),
		onComplete: function(transport){
			var ret = (transport.responseText).evalJSON();
			if(ret.result) {
				var commfriend = ret.data;
				var html = '你和他的共同好友： '; 
				var leng = commfriend.length;
				for (var i = 0; i < leng; i++) {
					var flag = (leng == (i + 1)) ? '' : '、';
					html += '<a href="/?uid=' + commfriend[i].id + '" target="_blank">' + commfriend[i].username + '</a>' + flag;
				}
		  		html += ' ' + leng + '人';
		  		$('commfriend_' + uid).update(html);
		  		$('mutu_friends_' + uid).show();
			} else {
				new MessageBox(MessageBox.TYPE_MESSAGE, '获取数据失败,请刷新页面重试', '提示', {close:function(){}});
			}
		}
	});	
}
</script>